<template>
	<el-container>
		<el-header>
			<el-page-header :content="data.name"></el-page-header>
			<div class="do">
				<el-button type="warning" round icon="el-icon-download" @click="exportJson">导出模板</el-button>
				<el-button round plain type="primary" icon="el-icon-folder-checked"  @click="save">保存</el-button>
				<el-button round type="primary" icon="el-icon-position" @click="exportJson">发布</el-button>
			</div>
		</el-header>
		<el-main>
			<jd-workflow v-model="data"></jd-workflow>
		</el-main>
	</el-container>
</template>

<script>
	import jdWorkflow from '@/components/jdWorkflow'

	export default {
		name: 'workflow',
		components: {
			jdWorkflow
		},
		data() {
			return {
				data: {
					"id": 'root',
					"name": "流程发起",
					"nodeConfig": {
						"nodeName": "发起人",
						"type": 0,
						"nodeRoleList": [],
						"submitBtn":true,
						"submitBtnText":'提交',
						"draftBtn":true,
						"draftBtnText":'草稿',
						"recallBtn":true,
						"recallBtnText":'撤回',
						"pressBtn":true,
						"pressBtnText":'催办',
						"printBtn":false,
						"printBtnText":'打印',
						"nodeForm":null,
						"dataForm":null,
						"formOption":[],
						"launchEvent":false,
						"launchEventId":null,
						"launchParam":null,
						"endEventId":null,
						"endParam":null,
						"endEvent":false,
						"recallEvent":false,
						"recallEventId":null,
						"recallEventParam":null,
						"waitMsg":'off',
						"waitMsgTemplateId":null,
						"waitMsgTemplateParam":null,
						"endMsg":'off',
						"endTemplateId":null,
						"endMsgTemplateParam":null,
						"successMsg":'off',
						"successTemplateId":null,
						"successTemplateParam":null,
						"refuseMsg":'off',
						"refuseMsgTemplateId":null,
						"refuseMsgTemplateParam":null,
						"copyMsg":'off',
						"copyMsgTemplateId":null,
						"copyMsgTemplateParam":null,
						"passMsg":'off',
						"passTemplateId":null,
						"passMsgTemplateParam":null,
						"props": {
							// 表单配置
							"formPerms": [],
							// 可发起的人员
							"assignedUser": [],
							// 可发起的人员角色
							"assignedRole": [],
						}
					}
				}
			}
		},
		mounted() {

		},
		methods: {
			// 导出模板
			exportJson() {
				this.$message("返回值请查看F12控制台console.log()")
				console.log(this.data)
			},
			// 保存
			save(){
				console.log(JSON.stringify(this.data))
			}
		}
	}
</script>

<style></style>
